/**
 * Project		: anveshitha
 * Filename		: anveshitha.displaytag.AnveshithaLinkDecorator.java
 * Author		: varun
 * Date			: Jun 18, 2008, 1:00:13 AM
 * Description	: 		
 * License		: GNU LESSER GENERAL PUBLIC LICENSE (http://www.gnu.org/licenses/lgpl-3.0.txt)
 */
package anveshitha.displaytag;

import org.apache.commons.lang.StringUtils;
import org.displaytag.decorator.TableDecorator;

import anveshitha.query.QueryResult;

/**
 * @author varun
 */
public class AnveshithaTableDecorator extends TableDecorator {
	
	public String getFilelink()
	{
	        
			QueryResult result = (QueryResult) getCurrentRowObject();
			String sURL = StringUtils.escape(result.getFilepath());
	        
	        //create link
	        StringBuffer sbLink = new StringBuffer();
	        sbLink.append("<a href=\"#\" onclick=\"openFile('");
	        sbLink.append(sURL);
	        sbLink.append("');\">");
	        sbLink.append(result.getFilename());
	        sbLink.append("</a>");	        
	        
	        return   sbLink.toString();
	}


}
